package com.zhouyu.service;

import java.beans.PropertyEditor;
import java.beans.PropertyEditorSupport;

/**
 * @author by gang.Li 2022/4/5 23:17
 */
public class StringToUserPropertyEditor extends PropertyEditorSupport implements PropertyEditor {

	@Override
	public void setAsText(String value) {
		User user = new User();
		user.setName(value);
		this.setValue(user);
	}

	public static void main(String[] args) {
		StringToUserPropertyEditor propertyEditor = new StringToUserPropertyEditor();
		propertyEditor.setAsText("1");
		User value = (User) propertyEditor.getValue();
		System.out.println(value);
	}
}
